from django.db import models
# Create your models here.


class ObservationRecord(models.Model):
    # 根据数据表头定义各个字段
    date = models.DateField()  # 日期字段
    data_status = models.CharField(max_length=10)  # 是否有数据 (如 "green")
    url = models.URLField()  # 网址
    observation_date = models.DateField()  # 观测日期
    observer = models.CharField(max_length=50)  # 观测人
    location = models.CharField(max_length=100)  # 地点
    cloud_cover = models.CharField(max_length=50)  # 云量
    weather = models.CharField(max_length=50)  # 天气情况
    altitude = models.IntegerField()  # 海拔
    observation_time = models.CharField(max_length=20)  # 观测时间 (如 "08:50_14:00")
    coordinates = models.CharField(max_length=50)  # 经纬度 (如 "E:100.02 N:26.41")
    number = models.IntegerField()  # 数字编号
    info = models.TextField()  # 其他信息 (如 "详细情况请见观测日志")

    def __str__(self):
        return f"{self.date} - {self.observer} - {self.location}"


